package guo.file;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class FileTest2 {
	public static void main(String[] args) {
		File file=new File("g:\\example.txt");
		try (InputStream is=new FileInputStream(file);
				OutputStream os=new FileOutputStream("g:\\1.txt");){
			
			
			byte[] buffer=new byte[10];
			while(is.read(buffer)!=-1) {
				os.write(buffer);
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}


}
